<%--
  Created by IntelliJ IDEA.
  User: 18306
  Date: 2020/11/19
  Time: 10:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<% String path = request.getContextPath(); %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<c:forEach items="${requestScope.pageInfo.list}" var="apply" >
    <ul class="reset resumeLists">
        <li data-id="1686182" class="onlineResume">

            <label class="checkbox">
                <input type="checkbox">
                <i></i>
            </label>
            <div class="resumeShow" style="border: 1px solid red">
                <a title="预览在线简历" target="_blank" class="resumeImg" href="resumeView.html?deliverId=1686182">
                    <img src="/static/images/default_headpic.png">
                </a>
                <div class="resumeIntro">
                    <h3 class="unread">
                        <a target="_blank" title="预览${apply.user.name}简历" href="/bossmanage/resumeView?id=${apply.user.eduExperience.recuitId}">
                                ${apply.user.name}的简历
                        </a>
                        <em></em>
                    </h3>
                    <span class="fr">投递时间：<fmt:formatDate value="${apply.sendTime}" pattern="yyyy-MM-dd hh:mm:ss"/></span>
                    <div>
                            ${apply.user.name}/${apply.user.sex}/${apply.user.workExperience.name}                   			                                       		                                            			                                        		<br>
                            ${apply.user.eduExperience.education.name}· ${apply.user.eduExperience.schoolName}
                                <span class="fr">邀请时间：<fmt:formatDate value="${apply.acceptedTime}" pattern="yyyy-MM-dd hh:mm:ss"/></span>
                    </div>

                    <div class="jdpublisher">
                                        <span>
                                            应聘职位：<a  href="">${apply.job.jobName}</a>
                                        </span>
                    </div>
                </div>
                <div class="links"   jobId="${apply.job.id}"  userId="${apply.user.id}">
                    <a  data-deliverid="1686182"  data-name="jason" data-positionid="149594" data-email="888888888@qq.com" class="resume_notice">提醒查看</a>
<%--                    <a data-deliverid="1686182"  class="resume_refuse" >不合适</a>--%>
                        <%--                                    <a data-deliverid="1686182" class="resume_caninterview" href="javascript:void(0)">待定</a>--%>
                    <a data-resumename="jason的简历" data-positionname="随便写" data-deliverid="1686182" data-positionid="149594" data-resumekey="1ccca806e13637f7b1a4560f80f08057" data-forwardcount="1" class="resume_forward" href="javascript:void(0)">
                            <%--                                        转发--%>
                            <%--                                        <span>(1人)</span>--%>
                    </a>
                </div>
            </div>
        </li>
    </ul>
</c:forEach>

<div class="page">
<%--    <c:forEach begin="1" end="${requestScope.pageInfo.pages}" var="i">--%>
<%--        <c:if test="${requestScope.pageInfo.pageNum eq i}" var="iscur">--%>
<%--            <span  class="isPage">[${i}]</span>--%>
<%--        </c:if>--%>
<%--        <c:if test="${not iscur}">--%>
<%--            [<a class="dian" href="#">${i}</a>]--%>
<%--        </c:if>--%>
<%--    </c:forEach>--%>
    <%--中间页--%>
    <%--显示6页中间页[begin=起始页,end=最大页]--%>
    <%--总页数没有6页--%>
    <c:choose>
        <c:when test="${requestScope.pageInfo.pages <= 5}">
            <c:set var="begin" value="1"/>
            <c:set var="end" value="${requestScope.pageInfo.pages}"/>
        </c:when>
        <%--页数超过了6页--%>
        <c:otherwise>
            <c:set var="begin" value="${requestScope.pageInfo.pageNum - 2}"/>
            <c:set var="end" value="${requestScope.pageInfo.pageNum + 2}"/>
            <%--如果begin减1后为0,设置起始页为1,最大页为5--%>
            <c:if test="${begin -1 <= 0}">
                <c:set var="begin" value="1"/>
                <c:set var="end" value="5"/>
            </c:if>
            <%--如果end超过最大页,设置起始页=最大页-4--%>
            <c:if test="${end > requestScope.pageInfo.pages}">
                <c:set var="begin" value="${requestScope.pageInfo.pages - 4}"/>
                <c:set var="end" value="${requestScope.pageInfo.pages}"/>
            </c:if>
        </c:otherwise>
    </c:choose>
    <%--遍历--%>
    <a  class="dian" pager="${requestScope.pageInfo.prePage}">上一页</a>
    <c:forEach var="i" begin="${begin}" end="${end}">
        <%--当前页,选中--%>
        <c:choose>
            <c:when test="${i == requestScope.pageInfo.pageNum}">
                [ <a style="color: red" >${i}</a>]
            </c:when>
            <%--不是当前页--%>
            <c:otherwise>
                [  <a class="dian" pager="${i}">${i}</a>]
            </c:otherwise>
        </c:choose>
    </c:forEach>
    <a  class="dian" pager="${requestScope.pageInfo.nextPage}">下一页</a>
    <%--    ${requestScope.pageInfo.pageNum}/${requestScope.pageInfo.pageCount}页--%>
</div>


</body>
</html>
<style>
    .page{
        text-align: center;
    }
    .isPage{
        color: red;
    }
    .dian:hover{
        font-weight: bold;
        color: black;
    }
</style>
